home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / boxe / Boxe.jar / Boxe / PSprite.class (.txt) < prev   
Encoding:
Java Class File  |  2002-04-12  |  1.6 KB  |  53 lines

  1. package Boxe;
  2.  
  3. import com.siemens.mp.game.Sprite;
  4.  
  5. class PSprite {
  6.    byte[] _pict;
  7.    byte[] _mask;
  8.    int _sizeX;
  9.    int _sizeY;
  10.    int _posX;
  11.    int _posY;
  12.    int _maxFrame;
  13.    Sprite _sprite;
  14.  
  15.    PSprite(String var1) {
  16.       System.gc();
  17.       PGraphicObj.OpenFile(var1);
  18.       PGraphicObj.ReadByte();
  19.       this._sizeX = PGraphicObj.ReadByte();
  20.       this._sizeY = PGraphicObj.ReadByte();
  21.       this._maxFrame = PGraphicObj.ReadShort();
  22.       this._pict = PGraphicObj.ReadByteArray(this._sizeX * this._sizeY * this._maxFrame / 8);
  23.       this._mask = PGraphicObj.ReadByteArray(this._sizeX * this._sizeY * this._maxFrame / 8);
  24.  
  25.       try {
  26.          System.gc();
  27.          this._sprite = new Sprite(this._pict, 0, this._sizeX, this._sizeY, this._mask, 0, this._maxFrame);
  28.       } catch (Exception var3) {
  29.          System.out.println("Fatal Error:No sprite created from " + var1);
  30.          return;
  31.       }
  32.  
  33.       PGraphicObj.CloseFile();
  34.       System.gc();
  35.    }
  36.  
  37.    public PSprite(PSprite var1) {
  38.       this._pict = var1._pict;
  39.       this._mask = var1._mask;
  40.       this._sizeX = var1._sizeX;
  41.       this._sizeY = var1._sizeY;
  42.       this._maxFrame = var1._maxFrame;
  43.       this._posX = 0;
  44.       this._posY = 0;
  45.  
  46.       try {
  47.          this._sprite = new Sprite(this._pict, 0, this._sizeX, this._sizeY, this._mask, 0, this._maxFrame);
  48.       } catch (Exception var3) {
  49.          System.out.println("Fatal Error:Couldn't clone sprite");
  50.       }
  51.    }
  52. }
  53.